<!doctype html>
<html lang="en">

<head>
<META HTTP-EQUIV="pragma" CONTENT="no-cache"> 
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate"> 
<META HTTP-EQUIV="expires" CONTENT="0">
<meta charset="UTF-8" />
<meta name="keywords" content="" />
<meta name="descrption" content="" />
<title>layui</title>
<script src="../../../js/angular.js"></script>
<link rel="stylesheet" href="../../../layui/css/layui.css" media="all">
<script src="../../../layui/layui/layui.js" charset="utf-8"></script>
<script src="../../../js/angular.js" charset="utf-8"></script>
<script src="../../../layui/jquery-3.2.1.min.js" charset="utf-8"></script>
<script type="text/javascript" src="../gjjhbj/fy.js"></script>
<script src="../../../layui/layui/layui.js" charset="utf-8"></script>
	<script type="text/javascript" src="../../../layui/js/jegs.js"></script>

	<link rel="stylesheet" href="../../../css/font_eolqem241z66flxr.css" media="all" />
	<link rel="stylesheet" href="../../../css/news.css" media="all" />
	<script type="text/javascript" src="../../../layui/layui/GetPath.js"></script>
	<script type="text/javascript" src="../../../js/ajaxfileupload.js"></script>
	<style>
	</style>
	
	</head>
	
<body  class="childrenBody">
	<!-- 邮件发送 -->
	
		
	<div ng-app="myApp" ng-controller="customersCtrl" align="center">
	<loading>查询中请稍后</loading>  
	<div class="sysNotice col">
			<blockquote class="layui-elem-quote title"><div style="float:left">基数核定</div>
			<a href="javascript:void(0);" onclick="js_method()" class="layui-btn " style="width:10%;padding-left:10px;"  >选择文件
    
</a><i id="wj"></i>

<input style="opacity:0;height:90%;hidden:hidden;width:0" type="file" name="file" id="filevideo" ng-change="ch()" ng-model="ch" class="layui-btn layui-btn-primary"  accept=".xls"  >
    
			<input type="submit"  class="layui-btn layui-btn-primary" id="sc" ng-click=sc(); style="width: 15%" value="上&nbsp;传&nbsp;基&nbsp;数&nbsp;文&nbsp;件">
			<a href="javascript:void(0);" ><input type="button"  ng-click="don()" class="layui-btn layui-btn-primary" style="width: 15%" value="下&nbsp;载&nbsp;基&nbsp;数&nbsp;核&nbsp;定&nbsp;模&nbsp;板"></a>
			<input type="button"  class="layui-btn layui-btn-primary"  ng-click=de(); style="width: 15%" value="全部删除">
			</blockquote>
			<table class="layui-table">
				<colgroup>
					<col width="10%"  style="min-width:100px">
					<col width="20%">
					<col width="10%" style="min-width:100px">
					<col  width="50%">
				</colgroup>
				<tbody>
					<tr>
						<td>单位缴存额合计</td>
						<td style="text-align:left;padding-left:20px;"><b id="DWJCEHJ">0.00</b></td>
						<td>个人缴存额合计</td>
						<td style="text-align:left;padding-left:20px;"><b id="GRJCEHJ">0.00</b></td>
					</tr>
				</tbody>
			</table>
			
		</div>
			
			
		<table class="layui-table" style="width:100%">
			<tr align="center" style="background-color:#f1f1f1">
				<td>姓名</td>
				<td>个人账号</td>
				<td>单位缴存比例</td>
				<td>个人缴存比例</td>
				<td>单位缴存额</td>
				<td>个人缴存额</td>
				<td>缴存基数</td>

			</tr>
			<tr ng-repeat="x in names" align="center">

				<td ng-if="$odd" style="background-color:#f1f1f1">{{ x.XINGMING }}</td>
				<td ng-if="$even">{{ x.XINGMING }}</td>
				<td ng-if="$odd" style="background-color:#f1f1f1">{{ x.GRZH }}</td>
				<td ng-if="$even">{{ x.GRZH }}</td>
				<td ng-if="$odd" style="background-color:#f1f1f1">{{ x.DWJCBL
					}}</td>
				<td ng-if="$even">{{ x.DWJCBL }}</td>
				<td ng-if="$odd" style="background-color:#f1f1f1">{{ x.GRJCBL
					}}</td>
				<td ng-if="$even">{{ x.GRJCBL }}</td>
				<td ng-if="$odd" style="background-color:#f1f1f1;text-align:right;">{{ x.DWJCE| currency:""
					}}</td>
				<td ng-if="$even" style="text-align:right;">{{ x.DWJCE| currency:"" }}</td>
				<td ng-if="$odd" style="background-color:#f1f1f1;text-align:right;">{{ x.GRJCE| currency:"" }}</td>
				<td ng-if="$even" style="text-align:right;">{{ x.GRJCE | currency:""}}</td>
				<td ng-if="$odd" style="background-color:#f1f1f1;text-align:right;">{{ x.JCJS | currency:""}}</td>
				<td ng-if="$even" style="text-align:right;">{{ x.JCJS | currency:""}}</td>
			</tr>
		</table>
		<div class="layui-btn-group">
			<button class="layui-btn layui-btn-primary layui-btn-sm"
				ng-click="Sy()">首页</button>
			<button class="layui-btn layui-btn-primary layui-btn-sm"
				ng-click="Previous()">上一页</button>
			<button ng-repeat="page in pageList" class="layui-btn layui-btn-primary layui-btn-sm "
				ng-click="selectPage(page)" >{{page}}</button>
			<button class="layui-btn layui-btn-primary layui-btn-sm"
				ng-click="Next()">下一页</button>
			<button class="layui-btn layui-btn-primary layui-btn-sm"
				ng-click="Wy()">尾页</button>
			<button class="layui-btn layui-btn-primary layui-btn-sm "
				>{{selPage}}/{{pages}}</button>
		</div>
  </div>
  	<script type="text/javascript" src="../../../js/log.js"></script>
  		<script type="text/javascript" src="../../../layui/lay/modules/layer.js"></script>
  	
  <script>
  layui.use('layer', function(){
 					 var layer = layui.layer;
				});  
  
  </script>
	<script type="text/javascript">
				
		function getPath() {
			return 'http://' + location.host;
		};
		var a;
		var app = angular.module('myApp', []);
			app.directive('loading', function(){  
		        return {  
		            restrict: 'E',  
		            transclude: true,  
		            template: '<div ng-show="loading" class="loading" id="allDiv"  style="position:fixed; top:0px; left:0px; width:100%; height:100%; display:none; background-color:#000; opacity: 0.5; z-index:99999;">'  
		            +'<img alt="" src="../../../layui/layui/img/jz.gif" style="vertical-align: middle;width:30px; height:30px; position: absolute; top:50%; left:50%; margin-top: -50px; margin-left:-50px;"/>'
		            +'</div>',  
		            link: function (scope, element, attr) {  
		                scope.$watch('loading', function (val) {  
		                    if (val){  
		                        document.getElementById("allDiv").style.display = "block";  
		                    }else{  
		                        document.getElementById("allDiv").style.display = 'none';  
		  
		                    }  
		                });  
		            }  
		        };
		    }); 
		app.controller('customersCtrl', function($scope, $http) {
			   $scope.setLoading =function(){  
			    if($scope.loading ==undefined || $scope.loading ==false){  
			        $scope.loading=true;  
			    }else{  
			        $scope.loading=false;  
			    };
			};
		$scope.setLoading();
		   $http({
		        url: getPath() + "/wsyyt/jshdcontroller/test3",
				method: 'POST'
				})
					.then(function(res){
					
					if(res.data.DWJCEHJ!=null&&res.data.DWJCEHJ!=""){
					$("#DWJCEHJ").html(formatCurrency(res.data.DWJCEHJ));
					$("#GRJCEHJ").html(formatCurrency(res.data.GRJCEHJ));
					}
					$scope.setLoading();
					 if(res.data.msg==null)
								 {
								 	layer.msg("登陆失效请重新登陆");
									setTimeout(function () {
										window.top.location.href=res.data;
									}, 1500);
									return;
								 }
				 if(res.data.msg!='成功')
								layer.alert('提示：'+res.data.msg, {
								      skin: 'layui-layer-molv' //样式类名  自定义样式
								     ,closeBtn: 1    // 是否显示关闭按钮
								      ,anim: 1 //动画类型
								     ,btn: ['确认'] //按钮
								      ,icon: 5    // icon
								     ,btn2:function(){
										
								     }});
					$scope.names=res.data.data;
					feny($scope.names);
					});
		$scope.don=function(){
		$scope.setLoading();
			   $http({
		        url: getPath() + "/wsyyt/jshdcontroller/test1",
				method: 'POST'
				})
					.then(function(res){
					console.info(res.data.filePath);
					window.location.href=getPath() +"/wsyyt/jshdcontroller/downloadexcels?filename="+res.data.filePath;
					$scope.setLoading();
					console.info(res);
					});
		};
	console.info($scope.names);
			$scope.de=function(){
			if($scope.names!=null&&$scope.names!="")
				layer.confirm('提示：确认删除？', {
							skin: 'layui-layer-molv',anim: 1,
							icon: 5    ,
							  btn: ['确认','取消'] //可以无限个按钮
							  ,btn1: function(index, layero){
							  	$scope.setLoading();
			   $http({
		        url: getPath() + "/wsyyt/jshdcontroller/delete",
		        params:{ID:$scope.names[0].LSH},
				method: 'POST'
				})
					.then(function(res){
					$scope.setLoading();
					window.location.reload();
					});
							  }
							});
								else
			layer.alert('提示：当前无记录', {
								      skin: 'layui-layer-molv' //样式类名  自定义样式
								     ,closeBtn: 1    // 是否显示关闭按钮
								      ,anim: 1 //动画类型
								     ,btn: ['确认'] //按钮
								      ,icon: 5    // icon
								     ,btn2:function(){
										
								     }});	
			
			}
			$scope.sc=function(){
			if($("#filevideo").get(0).files[0]==null)
			layer.alert('提示：请选择上传文件', {
								      skin: 'layui-layer-molv' //样式类名  自定义样式
								     ,closeBtn: 1    // 是否显示关闭按钮
								      ,anim: 1 //动画类型
								     ,btn: ['确认'] //按钮
								      ,icon: 5    // icon
								     ,btn2:function(){
										
								     }});	
			else{
			$scope.setLoading();
			  var fd=new FormData();  
	   fd.append("file",$("#filevideo").get(0).files[0])  ;
	   $http({
		        url: getPath() + "/wsyyt/jshdcontroller/test",
				method: 'POST',
				headers: {
				'Content-Type': undefined
				},
				transformRequest: function() {
				var formData = new FormData();
				formData.append('file',$("#filevideo").get(0).files[0]);
				return formData;
				}
				})
					.then(
							function(data) {
							$scope.setLoading();
							data=data.data;
	         if(data.length==0||data==null){
	         	layer.alert('提示：成功', {
								      skin: 'layui-layer-molv' //样式类名  自定义样式
								     ,closeBtn: 1    // 是否显示关闭按钮
								      ,anim: 1 //动画类型
								     ,btn: ['确认'] //按钮
								      ,icon: 5    // icon
								     ,btn2:function(){
										
								     }});	
	         	window.location.reload();  
	         	}
	         else
	         	{
	         	var myArray=new Array();
	         		for(var i=0;i<data.length;i++){
	         			myArray.push(data[i].msg);
	         		}
	         		var cc=JSON.stringify(myArray);
	         		layer.open({
  title: '错误信息'
  ,content: cc
});     
	         	}
			});
			}
			};
		});
		
	function getObjectURL(file) {
		var url = null;
		if (window.createObjectURL != undefined) { // basic
		url = window.createObjectURL(file);
		} else if (window.URL != undefined) { // mozilla(firefox)
		url = window.URL.createObjectURL(file);
		} else if (window.webkitURL != undefined) { // webkit or chrome
		url = window.webkitURL.createObjectURL(file);
		}
		return url;
	}

//上传文件

/* 	$("#sc").click(function(){  
	   var fd=new FormData();  
	   fd.append("file",$("#filevideo").get(0).files[0])  
	   $.ajax({  
		  url: getPath() + "/wsyyt/jshdcontroller/test",
	      type:"POST",  
	      processData: false,  
	      contentType:false,  
	      data: fd,  
	      xhr: function() {  // custom xhr  
	         myXhr = $.ajaxSettings.xhr();  
	         if(myXhr.upload){ // check if upload property exists  
	            myXhr.upload.addEventListener('progress',function(evt){  
	               $( "#upload_tip").dialog("open");  
	               var percentComplete = Math.round(evt.loaded*100 / evt.total);  
	               console.log(percentComplete);  
	            }, false); // for handling the progress of the upload  
	         }  
	         return myXhr;  
	      },  
	      success:function(data){  
	      data=JSON.parse(data);
	         if(data.length==0||data==null){
	         	alert("成功");
	         	}
	         else
	         	{
	         	var myArray=new Array();
	         		for(var i=0;i<data.length;i++){
	         			myArray.push(data[i].msg);
	         		}
	         	alert(myArray);
	         	}
	      }  
	   });  
	});  */ 
	</script>	
	<script>
	$("#filevideo").change(function(){
			if($("#filevideo").get(0).files[0]!=null)
			$("#wj").text($("#filevideo").get(0).files[0].name);
			else
			$("#wj").text("");
			});
			function js_method(){
				$('#filevideo').trigger("click");
			}
	
	</script>
</body>
</html>